package org.example.demo.service;

import org.example.spring.annotation.Component;
import org.example.spring.factory.BeanPostProcessor;

/**
 * @Author: qiu
 * @Date: 2025/11/19 23:58
 */
@Component
public class UserServiceBeanPostProcessor implements BeanPostProcessor {

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) {
        if ("userService".equals(beanName)) {
            System.out.println("UserService before initialization...");
        }
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) {
        if ("userService".equals(beanName)) {
            System.out.println("UserService after initialization...");
        }
        return bean;
    }
}
